Skip to content

Add RuntimeClassName feature flag#9072

Merged
knative-prow-robot merged 2 commits intoknative:masterfrom
ianlewis:runtimeclass
Aug 27, 2020
Merged

Add RuntimeClassName feature flag#9072
knative-prow-robot merged 2 commits intoknative:masterfrom
ianlewis:runtimeclass

Conversation

@ianlewis
Copy link
Contributor

Allow users to set runtimeClassName on services via the runtimeclassname
feature flag.

Issue #5306

Release Note

Added RuntimeClassName feature flag.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Aug 15, 2020
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 15, 2020
@knative-prow-robot
Copy link
Contributor

Welcome @ianlewis! It looks like this is your first PR to knative/serving 🎉

@knative-prow-robot
Copy link
Contributor

Hi @ianlewis. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot knative-prow-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. area/API API objects and controllers labels Aug 15, 2020
if cfg.Features.PodSpecNodeSelector != config.Disabled {
out.NodeSelector = in.NodeSelector
}
if cfg.Features.PodSpecRuntimeClassName != config.Disabled {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth adding a test for this, along same lines as the one for PodSpecTolerations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@julz
Copy link
Contributor

julz commented Aug 17, 2020

/ok-to-test

@knative-prow-robot knative-prow-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 17, 2020
@julz
Copy link
Contributor

julz commented Aug 17, 2020

@ianlewis out of interest, Im wondering whether using a PodSecurityPolicy to default RuntimeClass would fit your use case? Are there cases where you want the user to explicitly select runtimeClass for their ksvc, rather than having it implicit in a security policy (or an operator-set default)?

Copy link
Contributor Author

@ianlewis ianlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ianlewis out of interest, Im wondering whether using a PodSecurityPolicy to default RuntimeClass would fit your use case? Are there cases where you want the user to explicitly select runtimeClass for their ksvc, rather than having it implicit in a security policy (or an operator-set default)?

Thanks. That's a good question. I think adding the feature flag is the best option for a few reasons:

  1. I am trying to meet the needs of a broad set of customer use cases which may require sandboxed workloads to run alongside non-sandboxed workloads.
  2. PodSecurityPolicy is in beta and has had some growing pains IIRC. I don't feel comfortable right now asking customers to rely on it.
  3. Some customers will want to use PSP for validation rather than defaulting. i.e. set desired state explicitly themselves and validate using PSP, rather than setting the default for a namespace.
  4. PSP can be used as an alternative to, or in addition to this feature flag. i.e. they don't interfere with each other so it provides more flexibility and covers more use cases.

if cfg.Features.PodSpecNodeSelector != config.Disabled {
out.NodeSelector = in.NodeSelector
}
if cfg.Features.PodSpecRuntimeClassName != config.Disabled {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-knative-serving-upgrade-tests 2020-08-19 01:01:10.785 +0000 UTC 1/3

Automatically retrying due to test flakiness...
/test pull-knative-serving-upgrade-tests

@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-knative-serving-integration-tests 2020-08-19 01:01:10.773 +0000 UTC 1/3

Automatically retrying due to test flakiness...
/test pull-knative-serving-integration-tests

@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-knative-serving-autotls-tests 2020-08-19 01:01:10.801 +0000 UTC 1/3

Automatically retrying due to test flakiness...
/test pull-knative-serving-autotls-tests

@julz
Copy link
Contributor

julz commented Aug 19, 2020

/retest

Copy link
Contributor

@julz julz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 19, 2020
@julz
Copy link
Contributor

julz commented Aug 20, 2020

/assign @dprotaso @mattmoor

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 23, 2020
Allow users to set runtimeClassName on services via the runtimeclassname
feature flag.

Issue knative#5306
@knative-prow-robot knative-prow-robot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 24, 2020
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/serving/fieldmask.go 98.1% 98.1% 0.0

}

func TestPodSpecFeatureValidation(t *testing.T) {
runtimeClassName := "test"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume there is no good way to validate the values passed (besides podspec dry run?), since it varies so much vendor to vendor...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose the controller could validate that the RuntimeClass with that name exists and add to the knative service's status and emit an event if it doesn't. Currently the controller will fail to create pods and users will see that the service didn't create and see the detailed reason in events already so I'm not sure it would be a much better UX.

@mattmoor
Copy link
Member

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 27, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ianlewis, mattmoor

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 27, 2020
@knative-prow-robot knative-prow-robot merged commit 6657049 into knative:master Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/API API objects and controllers cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants